<?php
/*
array(3) {
  ["num"]=>
  string(1) "1"
  ["decorates"]=>
  array(1) {
    [0]=>
    string(13) "producePinyin"
  }
  ["type"]=>
  string(12) "pinyinDomain"
}
*/
require("Abstract.class.php");
class PinyinDomain extends Domain
{
	private $_num;
	
	public function __construct($num)
	{
		parent::__construct();
		$this->_num = $num;
	}
	
	public function producePinyin()
	{
		$pinyin = file('lib/pinyin.txt');

		for ($i=0; $i<count($pinyin); $i++) {
			$wordsA[] = trim($pinyin[$i]);
			for($j=0; $j<count($pinyin); $j++) {
				$pinyin[$i] = trim($pinyin[$i]);
				$pinyin[$j] = trim($pinyin[$j]);
				$wordsAA[] = $pinyin[$i].$pinyin[$j];
				$wordsAAB[] = str_repeat($pinyin[$i], 2).$pinyin[$j];
				$wordsABB[] = $pinyin[$i].str_repeat($pinyin[$j], 2);
			}
		}
		$words = array_merge($wordsA, $wordsAA, $wordsAAB, $wordsABB);

		//$pinyindomain = implode("\r", $words);
		//return $this->addSuffixes($words);
		echo "pinyin";
		return $words;
	}
}

?>